<?php

use yii\db\Migration;

/**
 * Class m210120_144223_fix_page_table
 */
class m210120_144223_fix_page_table extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('page', 'view', $this->string());
        $this->addColumn('page', 'is_draft', $this->boolean()->defaultValue(0));
        $this->addColumn('page', 'is_module', $this->boolean()->defaultValue(0));
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {   
        $this->dropColumn('page', 'view');
        $this->dropColumn('page', 'is_draft');
        $this->dropColumn('page', 'is_module');
    }
}
